package com.yongren.mall.goods.controller;


import com.yongren.mall.goods.entity.Brand;
import com.yongren.mall.goods.service.IBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 商品品牌 前端控制器
 * </p>
 *
 * @author yongren
 * @since 2021-07-18
 */
@Api(tags = "商品品牌 前端控制器")
@RestController
@RequestMapping(value = "/goods/brand", produces = MediaType.APPLICATION_JSON_VALUE)
public class BrandController {
    @Autowired
    IBrandService brandService;

    @ApiOperation("增加一条品牌记录")
    @PostMapping(value = "/add")
    @ApiImplicitParams({@ApiImplicitParam("传入品牌实体")})
    public Boolean add(Brand brand) {
        Boolean result = brandService.save(brand);
        return result;
    }
}

